package com.sp.scmdb.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.sp.scmdb.common.DomainObject;

@Entity
@Table(name = "OBJ_DUTY")
public class Duty extends DomainObject {

	@Column(name = "name")
	private String name;
	
	@Column(name="dutyLevelId")
	private Integer dutyLevelId;
	
	@Column(name = "RMK")
	private String rmk;
	
	@Column(name = "sortindex")
	private Integer sortindex;
	

	public Integer getSortindex() {
		return sortindex;
	}

	public void setSortindex(Integer sortindex) {
		this.sortindex = sortindex;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "dutyLevelId", insertable = false, updatable = false)
	@NotFound(action=NotFoundAction.IGNORE) 
	private DutyLevel dutyLevel;

	public DutyLevel getDutyLevel() {
		return dutyLevel;
	}

	public void setDutyLevel(DutyLevel dutyLevel) {
		this.dutyLevel = dutyLevel;
	}

	public String getRmk() {
		return rmk;
	}

	public void setRmk(String rmk) {
		this.rmk = rmk;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getDutyLevelId() {
		return dutyLevelId;
	}

	public void setDutyLevelId(Integer dutyLevelId) {
		this.dutyLevelId = dutyLevelId;
	}
}
